<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>JSON Voorhees: jsonv::compare_traits Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script src="http://www.mathjax.org/mathjax/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">JSON Voorhees
   </div>
   <div id="projectbrief">Killer JSON for C++</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('structjsonv_1_1compare__traits.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="structjsonv_1_1compare__traits-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">jsonv::compare_traits Struct Reference<div class="ingroups"><a class="el" href="group__Algorithm.html">Algorithm</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Traits describing how to perform various aspects of comparison.  
 <a href="structjsonv_1_1compare__traits.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="algorithm_8hpp_source.html">jsonv/algorithm.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ada2685a49525b7927b8467bf3bfb2688"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjsonv_1_1compare__traits.html#ada2685a49525b7927b8467bf3bfb2688">compare_kinds</a> (<a class="el" href="group__Value.html#ga3721c2ed2f380809f2fc3b03a6f6fa53">kind</a> a, <a class="el" href="group__Value.html#ga3721c2ed2f380809f2fc3b03a6f6fa53">kind</a> b)</td></tr>
<tr class="memdesc:ada2685a49525b7927b8467bf3bfb2688"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare two kinds <em>a</em> and <em>b</em>.  <a href="#ada2685a49525b7927b8467bf3bfb2688">More...</a><br/></td></tr>
<tr class="separator:ada2685a49525b7927b8467bf3bfb2688"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba3ea1617e26ba22fd41c6bcf2d306a0"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjsonv_1_1compare__traits.html#aba3ea1617e26ba22fd41c6bcf2d306a0">compare_booleans</a> (bool a, bool b)</td></tr>
<tr class="memdesc:aba3ea1617e26ba22fd41c6bcf2d306a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare two boolean values.  <a href="#aba3ea1617e26ba22fd41c6bcf2d306a0">More...</a><br/></td></tr>
<tr class="separator:aba3ea1617e26ba22fd41c6bcf2d306a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a37f8b91e721c80c6b9294118869492f1"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjsonv_1_1compare__traits.html#a37f8b91e721c80c6b9294118869492f1">compare_integers</a> (std::int64_t a, std::int64_t b)</td></tr>
<tr class="memdesc:a37f8b91e721c80c6b9294118869492f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare two integer values.  <a href="#a37f8b91e721c80c6b9294118869492f1">More...</a><br/></td></tr>
<tr class="separator:a37f8b91e721c80c6b9294118869492f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7b57abc5aac760a412a41287c917c9e"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjsonv_1_1compare__traits.html#ac7b57abc5aac760a412a41287c917c9e">compare_decimals</a> (double a, double b)</td></tr>
<tr class="memdesc:ac7b57abc5aac760a412a41287c917c9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare two decimal values.  <a href="#ac7b57abc5aac760a412a41287c917c9e">More...</a><br/></td></tr>
<tr class="separator:ac7b57abc5aac760a412a41287c917c9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04f50461117bbdf0732d2adbd328cb23"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjsonv_1_1compare__traits.html#a04f50461117bbdf0732d2adbd328cb23">compare_strings</a> (const std::string &amp;a, const std::string &amp;b)</td></tr>
<tr class="memdesc:a04f50461117bbdf0732d2adbd328cb23"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare two string values.  <a href="#a04f50461117bbdf0732d2adbd328cb23">More...</a><br/></td></tr>
<tr class="separator:a04f50461117bbdf0732d2adbd328cb23"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeaab0ba4c97fb5b922513c6a700dfbfa"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjsonv_1_1compare__traits.html#aeaab0ba4c97fb5b922513c6a700dfbfa">compare_object_keys</a> (const std::string &amp;a, const std::string &amp;b)</td></tr>
<tr class="memdesc:aeaab0ba4c97fb5b922513c6a700dfbfa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare two strings used for the keys of objects.  <a href="#aeaab0ba4c97fb5b922513c6a700dfbfa">More...</a><br/></td></tr>
<tr class="separator:aeaab0ba4c97fb5b922513c6a700dfbfa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2794af52a6653022fe43286f4395714"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjsonv_1_1compare__traits.html#ac2794af52a6653022fe43286f4395714">compare_objects_meta</a> (const <a class="el" href="classjsonv_1_1value.html">value</a> &amp;, const <a class="el" href="classjsonv_1_1value.html">value</a> &amp;)</td></tr>
<tr class="memdesc:ac2794af52a6653022fe43286f4395714"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare two objects <em>before</em> comparing the values.  <a href="#ac2794af52a6653022fe43286f4395714">More...</a><br/></td></tr>
<tr class="separator:ac2794af52a6653022fe43286f4395714"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Traits describing how to perform various aspects of comparison. </p>
<p>This implementation for comparison is strict and is ultimately the one used by <code><a class="el" href="classjsonv_1_1value.html#a05f2fca552d114e678040be40c8cbc06" title="Used to build a strict-ordering of JSON values. ">value::compare</a></code>.</p>
<dl class="section see"><dt>See Also</dt><dd>compare </dd></dl>

<p>Definition at line <a class="el" href="algorithm_8hpp_source.html#l00038">38</a> of file <a class="el" href="algorithm_8hpp_source.html">algorithm.hpp</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="aba3ea1617e26ba22fd41c6bcf2d306a0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int jsonv::compare_traits::compare_booleans </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compare two boolean values. </p>

<p>Definition at line <a class="el" href="algorithm_8hpp_source.html#l00052">52</a> of file <a class="el" href="algorithm_8hpp_source.html">algorithm.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="ac7b57abc5aac760a412a41287c917c9e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int jsonv::compare_traits::compare_decimals </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compare two decimal values. </p>

<p>Definition at line <a class="el" href="algorithm_8hpp_source.html#l00068">68</a> of file <a class="el" href="algorithm_8hpp_source.html">algorithm.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="a37f8b91e721c80c6b9294118869492f1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int jsonv::compare_traits::compare_integers </td>
          <td>(</td>
          <td class="paramtype">std::int64_t&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::int64_t&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compare two integer values. </p>

<p>Definition at line <a class="el" href="algorithm_8hpp_source.html#l00060">60</a> of file <a class="el" href="algorithm_8hpp_source.html">algorithm.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="ada2685a49525b7927b8467bf3bfb2688"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int jsonv::compare_traits::compare_kinds </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__Value.html#ga3721c2ed2f380809f2fc3b03a6f6fa53">kind</a>&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__Value.html#ga3721c2ed2f380809f2fc3b03a6f6fa53">kind</a>&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compare two kinds <em>a</em> and <em>b</em>. </p>
<p>This should return 0 if the types are the same or if they are directly comparable (such as <code>kind::integer</code> and <code>kind::decimal</code>) &ndash; if you return 0 for non-comparable types, you risk getting a <code><a class="el" href="classjsonv_1_1kind__error.html" title="Thrown from various value methods when attempting to perform an operation which is not valid for the ...">kind_error</a></code> thrown. </p>

<p>Definition at line <a class="el" href="algorithm_8hpp_source.html#l00044">44</a> of file <a class="el" href="algorithm_8hpp_source.html">algorithm.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="aeaab0ba4c97fb5b922513c6a700dfbfa"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int jsonv::compare_traits::compare_object_keys </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compare two strings used for the keys of objects. </p>

<p>Definition at line <a class="el" href="algorithm_8hpp_source.html#l00082">82</a> of file <a class="el" href="algorithm_8hpp_source.html">algorithm.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="ac2794af52a6653022fe43286f4395714"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int jsonv::compare_traits::compare_objects_meta </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classjsonv_1_1value.html">value</a> &amp;&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classjsonv_1_1value.html">value</a> &amp;&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compare two objects <em>before</em> comparing the values. </p>
<p>The <code>compare</code> function will only check the contents of an object if this function returns 0. </p>

<p>Definition at line <a class="el" href="algorithm_8hpp_source.html#l00090">90</a> of file <a class="el" href="algorithm_8hpp_source.html">algorithm.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="a04f50461117bbdf0732d2adbd328cb23"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int jsonv::compare_traits::compare_strings </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Compare two string values. </p>

<p>Definition at line <a class="el" href="algorithm_8hpp_source.html#l00076">76</a> of file <a class="el" href="algorithm_8hpp_source.html">algorithm.hpp</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>jsonv/<a class="el" href="algorithm_8hpp_source.html">algorithm.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>jsonv</b></li><li class="navelem"><a class="el" href="structjsonv_1_1compare__traits.html">compare_traits</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
